<!--
 * @Description: 
 * @Version: 1.0
 * @Autor: gaoluo
 * @Date: 2021-08-24 19:56:26
 * @LastEditors: gaoluo
 * @LastEditTime: 2021-10-12 17:44:07
 * @FilePath: /nhw/src/views/Work/WorkflowSteps.vue
-->
<template>
  <Layout class="workflow-steps-container" title="流程图" border>
    <component :is="Steps" :stepData="workflowData"></component>
  </Layout>
</template>

<script>
import Layout from "components/Layout";
import Steps from "components/Steps";
import axios from "axios";
import qs from "qs";
export default {
  name: "WorkflowSteps",

  components: { Layout, Steps },

  directives: {},

  data() {
    return {
      workflowData: {},
      Steps: "",
    };
  },
  created() {
    this.getList(this.$route.params).then((res) => {
      this.workflowData = res;
      this.$toast.clear();
      this.Steps = Steps;
    });
  },
  mounted() {},

  methods: {
    async getList(data) {
      const token = window.localStorage.getItem("access_token");
      this.$toast.loading("数据加载中...");
      const res = await axios({
        method: "post",
        url: `workflowHandleLog.ajax?access_token=${token}`,
        baseURL: "/nhw/system/Aworkflow/",
        data: qs.stringify(data),
      });
      if (res.status === 200) {
        return res.data;
      } else {
        this.$toast("网络错误！");
      }
    },
  },
};
</script>

<style lang="less" scoped>
.workflow-steps-container {
  .steps-container {
    padding-top: 10px;
  }
}
</style>